#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Game main module.
#
#Sets up necessary modules and hands control over to the game module
#

import data
import default
import pygame
import game
import music
from pygame.locals import *

def setup_display():
    try:
        pygame.init()
        pygame.display.set_mode(default.screen_size)
        pygame.display.set_caption(default.window_caption)
        screen = pygame.display.get_surface()
    except pygame.error, message:
        print "An error occurred. Could not initilialize pygame."
        raise SystemExit, message
    return screen

def main():
    
    screen = setup_display()
    le_game = game.Game(screen)

    #det här är alltså en exempelkommentar
    #music.play_music('example')

    #This is where IT SPINS OUT OF CONTROL AAAH!
    le_game.run()
    
